# -*- coding: utf-8 -*-
# coding:unicode_escape


import time
from parking_lot.parking import ParkingLot, Parking
from parking_lot.parking_manage_system import ParkingManageSystem

if __name__ == '__main__':
    parking_lotA = ParkingLot("停车场A",3)
    parking_lotA_name = parking_lotA.get_parking_name()
    parking_lotA_capacity = parking_lotA.get_capacity()
    parking_lotA_cars = parking_lotA.get_cars()
    
    parking_lotB = ParkingLot("停车场B",5)
    parking_lotB_name = parking_lotB.get_parking_name()
    parking_lotB_capacity = parking_lotB.get_capacity()
    parking_lotB_cars = parking_lotB.get_cars()
    
    parking_info_list = [(parking_lotA_name, parking_lotA_capacity, parking_lotA_cars),(parking_lotB_name, parking_lotB_capacity, parking_lotB_cars)]
    parking_strategy = "max_first"
    
    park = ParkingManageSystem(parking_info_list, parking_strategy)
    park.park("京AB37880")
    park.park("京AB37881")
    park.park("京AB37882")
    park.park("京AB37883")
    park.park("京AB37884")
    park.park("京AB37885")
    park.park("京AB37886")
    park.park("京AB37887")
    park.park("京AB37888")
    time.sleep(10)
    park.pick_up("京AB37881")
    park.park("京AB37885")
    park.pick_up("京AB37880")
    park.pick_up("京AB37883")
    park.pick_up("京AB37882")
    park.park("京AB37890")
